home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
vbkontrol.exe
/
UDP_101N.ZIP
/
ECHO.FRM
< prev
next >
Wrap
Text File
|
1995-04-04
|
3KB
|
108 lines
VERSION 2.00
Begin Form Form1
Caption = "UDP ECHO Demo"
ClientHeight = 5175
ClientLeft = 1125
ClientTop = 1995
ClientWidth = 7845
ForeColor = &H00000080&
Height = 5580
Left = 1065
LinkTopic = "Form1"
ScaleHeight = 5175
ScaleWidth = 7845
Top = 1650
Width = 7965
Begin CommandButton Command2
Caption = "Clear"
Height = 375
Left = 5880
TabIndex = 3
Top = 300
Width = 1335
End
Begin TextBox tAddress
Height = 285
Left = 2280
TabIndex = 1
Text = "127.0.0.1"
Top = 360
Width = 2055
End
Begin CommandButton Command1
Caption = "Test!!"
Height = 375
Left = 4440
TabIndex = 0
Top = 300
Width = 1335
End
Begin UDPPORT UDPPort1
InBufferSize = 2048
Left = 3480
LocalPort = 0
OutBufferSize = 2048
RemoteHost = "255.255.255.255"
RemotePort = 0
Top = 720
End
Begin Label Label2
Caption = "For best results, run an instance of this demo in *different* machines (simultaneously)."
ForeColor = &H000000FF&
Height = 255
Left = 120
TabIndex = 4
Top = 60
Width = 7695
End
Begin Label Label1
Caption = "Remote Host Address:"
Height = 255
Left = 120
TabIndex = 2
Top = 360
Width = 1935
End
End
Sub Command1_Click ()
UDPPort1.Active = False
UDPPort1.LocalPort = 7 'so that it listens too
'careful!! - if you reply from this port,
'infinite loops might result
UDPPort1.Active = True
UDPPort1.RemoteHost = tAddress.Text
UDPPort1.RemotePort = 7
TestData$ = "test!!!"
UDPPort1.DataToSend = TestData$
Me.ForeColor = &HFF0000
Print "To: ", UDPPort1.RemoteHost & ":" & UDPPort1.RemotePort & " :: " & TestData$
End Sub
Sub Command2_Click ()
Cls: Print : Print : Print : Print
End Sub
Sub Form_Load ()
Cls: Print : Print : Print : Print
End Sub
Sub UDPPort1_DataIn (Datagram As String, SourceAddress As String, SourcePort As Integer)
Me.ForeColor = &H80&
Print "From: ", SourceAddress & ":" & SourcePort & " :: " & Datagram
End Sub